package com.cinc.ebc.mm.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cinc.ebc.mm.entity.MmPurchaseRequisitionDetail;
import com.cinc.ebc.mm.mapper.MmPurchaseRequisitionDetailMapper;
import com.cinc.ebc.mm.model.MmPurchaseRequisitionDetailModel;
import com.cinc.ebc.mm.service.IMmPurchaseRequisitionDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 采购申请明细
 * @Author: jeecg-boot
 * @Date:   2022-03-20
 * @Version: V1.0
 */
@Service
public class MmPurchaseRequisitionDetailServiceImpl extends ServiceImpl<MmPurchaseRequisitionDetailMapper, MmPurchaseRequisitionDetail> implements IMmPurchaseRequisitionDetailService {
	
	@Autowired
	private MmPurchaseRequisitionDetailMapper mmPurchaseRequisitionDetailMapper;
	
	@Override
	public IPage<MmPurchaseRequisitionDetail> selectPageByMainId(IPage<MmPurchaseRequisitionDetail> page, String mainId) {

		return page.setRecords(mmPurchaseRequisitionDetailMapper.selectByMainId(page, mainId));
	}

	@Override
	public List<MmPurchaseRequisitionDetail> selectByMainId(String mainId) {

		return mmPurchaseRequisitionDetailMapper.selectByMainId(null, mainId);
	}

	@Override
	public IPage<MmPurchaseRequisitionDetailModel> selectAllPageByMainId(IPage<MmPurchaseRequisitionDetailModel> page, String mainId) {

		return page.setRecords(mmPurchaseRequisitionDetailMapper.selectAllByMainId(page, mainId));
	}

	@Override
	public List<MmPurchaseRequisitionDetailModel> selectAllByMainId(String mainId) {

		return mmPurchaseRequisitionDetailMapper.selectAllByMainId(null, mainId);
	}

	@Override
	public List<String> selectIdByMainId(List<String> mainIds) {
		return mmPurchaseRequisitionDetailMapper.selectIdByMainId(mainIds);
	}
}
